<?php defined( '_JEXEC' ) or die( 'Restricted access' ); ?><?php defined( '_SEXEC' ) or die( 'Restricted access' ); ?>
<?php
	if(!isset($_SESSION['username']) && !isset($_SESSION['usertype']))
		header("location: index.php");
?>
<?php	

if(isset($submit)) {
	b($pan_no, "Enter PAN Number!");
	b($servicetax_no, "Enter Service Tax Number!");
	b($servicetax_charge, "Enter Service Tax Percentage!");
	b($ecess_charge, "Enter Edu. CESS on Service Tax Percentage!");
	b($hsecess_charge, "Enter Higher Sec. Edu. CESS on Service Tax Percentage!");
	if(count($arr) == 0) {
		$sql="update settings set pan_no=\"$pan_no\", servicetax_no=\"$servicetax_no\", servicetax_charge=\"$servicetax_charge\",ecess_charge=\"$ecess_charge\", hsecess_charge=\"$hsecess_charge\"";
		mysql_query($sql);
		$msg = "Settings updated succesful";
	}
} else {
	$sql = "select * from settings";
	$result = mysql_query($sql);
	$row = mysql_fetch_array($result);
	$pan_no = $row['pan_no'];
	$servicetax_no = $row['servicetax_no'];
	$servicetax_charge = $row['servicetax_charge'];
	$ecess_charge = $row['ecess_charge'];
	$hsecess_charge = $row['hsecess_charge'];
	
}

	


?>

<div id="title">Setting Management</div>

<form name="setting-form" method="post" action="">
<table border="0" cellspacing="3" cellpadding="3" align="center">
	<tr>
		<td colspan=2>
			<?php
				se();
			?>
		</td>
	</tr>
	<tr>
		<td align=right>PAN Number :</td>
		<td><input name="pan_no" type="text" value="<?php echo $pan_no?>"/></td>
	</tr>
	<tr>
		<td align=right>Service Tax Number :</td>
		<td><input name="servicetax_no" type="text" value="<?php echo $servicetax_no?>"/></td>
	</tr>
	<tr>
		<td align=right>Service Tax Charge (%) :</td>
		<td><input name="servicetax_charge" type="text" value="<?php echo $servicetax_charge?>"/></td>
	</tr>
	<tr>
		<td align=right>Edu. CESS on Service Tax (%) :</td>
		<td><input name="ecess_charge" type="text" value="<?php echo $ecess_charge?>"/></td>
	</tr>
	<tr>
		<td align=right>Higher Sec. Edu. CESS  on Service Tax (%) :</td>
		<td><input name="hsecess_charge" type="text" value="<?php echo $hsecess_charge?>"/></td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<input type="submit" name="submit" value="Update" class='button'/>
		</td>
	</tr>	
</table>
</form>